]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
osdWindow: scale by scaleFactor
authorCosimo Cecchi <cosimoc@gnome.org>
Tue, 18 Feb 2014 04:55:15 +0000 (20:55 -0800)
committerCosimo Cecchi <cosimoc@gnome.org>
Tue, 18 Feb 2014 15:46:07 +0000 (07:46 -0800)
Since we calculate this dimensions from the size of the monitor, the
result was too large. Scale it by scaleFactor instead.

https://bugzilla.gnome.org/show_bug.cgi?id=724607

js/ui/osdWindow.js

index 1d10f800a11755b153533649841a6ae9fc7706fc..c9cb77d78a129e372d861f0372f1bad0e195ab5c 100644 (file)
@@ -200,8 +200,9 @@ const OsdWindow = new Lang.Class({
         let scale = Math.min(scalew, scaleh);
         this._popupSize = 110 * Math.max(1, scale);
 
+        let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
+        this._icon.icon_size = this._popupSize / (2 * scaleFactor);
         this._box.translation_y = monitor.height / 4;
-        this._icon.icon_size = this._popupSize / 2;
         this._box.style_changed();
     },
 
@@ -217,7 +218,10 @@ const OsdWindow = new Lang.Class({
         let minWidth = this._popupSize - verticalPadding - leftBorder - rightBorder;
         let minHeight = this._popupSize - horizontalPadding - topBorder - bottomBorder;
 
-        this._box.style = 'min-height: %dpx;'.format(Math.max(minWidth, minHeight));
+        // minWidth/minHeight here are in real pixels,
+        // but the theme takes measures in unscaled dimensions
+        let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
+        this._box.style = 'min-height: %dpx;'.format(Math.max(minWidth, minHeight) / scaleFactor);
     },
 
     setMonitor: function(index) {